package org.example.springmessage.service.impl;

import org.example.springmessage.domain.Message;
import org.example.springmessage.mapper.MessageMapper;
import org.example.springmessage.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private MessageMapper messageMapper;
    @Override
    public List<Message> getAllMessages() {
        return messageMapper.getAllMessages();
    }

    @Override
    public List<Message> getByUserId(Integer userid) {
        return messageMapper.getByUserId(userid);
    }

    @Override
    public boolean delete(Integer id) {
        return messageMapper.delete(id);
    }

    @Override
    public boolean addMessage(Message message) {
        return messageMapper.addMessage(message);
    }

    @Override
    public List<Message> getMessageByTag(String tag) {
        return messageMapper.getMessageByTag(tag);
    }


}
